package org.example.util;

import cn.hutool.core.io.resource.ClassPathResource;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.Charset;

public class ClassPathUtil {
    public static String load(String path){
        BufferedReader br = new  ClassPathResource(path).getReader(Charset.defaultCharset());
        StringBuilder sb = new StringBuilder();
        String line = "";
        try {
            while((line = br.readLine()) != null){
                sb.append(line + "\n");
            }
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return sb.toString();

    }

}
